<template>
    <div class="page">
        <div class="bg">
            <div class="line-1">未来体验中心VR/AR端</div>
            <div class="line-2">让视野更丰富</div>
            <div class="line">
                <div>版本：1.0.1</div>
                <div>更新时间：2024.01.20</div>
            </div>

            <div class="btn-group">
                <div class="btn-item btn-item-1">下载安装包</div>
                <div class="btn-item btn-item-2">查看安装视频</div>
            </div>
        </div>

        <div class="container">
            <div class="download-box">
                <div class="download-desc">
                    <div class="download-info">
                        <div class="download-desc__title">更新信息</div>
                        <div class="download-desc__content">
                            <p>版本号：{{ detail.version }}</p>
                            <p>发布日期：{{ detail.time }}</p>
                            <p>
                                文件大小：{{ formatFileSize(detail.size || 0) }}
                            </p>
                        </div>
                    </div>
                    <div class="download-ask">
                        <div class="download-desc__title">配置要求</div>
                        <div
                            class="download-desc__content"
                            v-html="detail.demand"
                        ></div>
                    </div>
                </div>
            </div>
        </div>

        <div class="bg-1"></div>

        <div class="pic-list">
            <div class="pic-item" v-for="item in list" :key="item.id">
                <div class="pic-img">
                    <img
                        :src="
                            `${_oss_}images/vr-download/pic-${item.id}.jpg` +
                            '?x-oss-process=image/watermark,image_' +
                            toBase64(
                                'water/logo_white.png?x-oss-process=image/resize,P_50'
                            ) +
                            ',g_center,t_50'
                        "
                    />
                </div>
                <div class="pic-info">
                    <img
                        class="num-img"
                        :src="`${_oss_}images/vr-download/${item.id}.jpg`"
                    />
                    {{ item.content }}
                </div>
            </div>
        </div>
    </div>
</template>
<script setup>
import { useContent } from ".";
const { detail, list, GetInfo } = useContent();

await GetInfo();
</script>
<style lang="scss" scoped>
.page {
    background-color: #edf5fa;
    padding-bottom: 72px;
}

.bg {
    position: relative;
    width: 100%;
    height: 30.02vw;
    background: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/future-experience-center/vr/bg.jpg");
    background-size: 100% 100%;

    .line-1 {
        position: absolute;
        top: 6.66vw;
        left: 50%;
        font-size: 2.6vw;
        transform: translateX(-50%);
        color: #fff;
    }

    .line-2 {
        position: absolute;
        top: 10.1vw;
        left: 50%;
        font-size: 2.6vw;
        transform: translateX(-50%);
        color: #fff;
    }

    .line {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: absolute;
        left: 50%;
        top: 15.36vw;
        width: 20.83vw;
        height: 2.29vw;
        background-image: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/future-experience-center/vr/line-bg.png");
        background-size: 100% 100%;
        transform: translateX(-50%);
        font-size: 0.93vw;
        padding: 0 2.3vw;
        color: #333;
    }

    .btn-group {
        display: flex;
        position: absolute;
        left: 50%;
        bottom: 4.16vw;
        transform: translateX(-50%);

        .btn-item {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 10.41vw;
            height: 2.6vw;
            border-radius: 1.3vw;
            user-select: none;
            // cursor: pointer;
            font-size: 1.04vw;

            &-1 {
                color: #fff;
                // background: linear-gradient(63deg, #2065FF, #52D0FF);
                background-color: #ccc;
                margin-right: 3.125vw;
            }

            &-2 {
                background: #fff;
                color: #5085fb;
            }
        }
    }
}

.bg-1 {
    width: 100%;
    height: 150px;
    background: url("https://yzpt-resources.oss-cn-hangzhou.aliyuncs.com/web/images/vr-download/bg-1.jpg")
        no-repeat 50% 0 / cover;
}

.container {
    width: 1200px;
    margin: 0 auto;
    padding: 30px 0 50px;

    .tips {
        font-size: 16px;
        line-height: 24px;
        color: #666;
    }

    .download-box {
        width: 1200px;
        padding: 30px 30px 40px;
        background-color: #fff;
        border-radius: 20px;
    }

    .download-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 250px;
        height: 50px;
        font-size: 18px;
        background-color: #3f00f2;
        color: #fff;
        border-radius: 40px;
        overflow: hidden;
        cursor: pointer;
        text-decoration: none;
    }

    .download-desc {
        display: flex;
        padding: 0px 22px;

        &__title {
            color: #333;
            font-weight: bold;
        }

        &__content {
            margin-top: 20px;
            font-size: 14px;
            line-height: 26px;
            color: #444;
            white-space: pre-line;
        }

        .download-info,
        .download-ask {
            flex: 1;
        }
    }
}

.pic-list {
    width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    padding: 30px;
    background-color: #fff;
    border-radius: 20px;
    margin-top: 30px;

    .pic-item {
        width: 360px;
        margin-right: 30px;
        margin-bottom: 10px;

        &:nth-of-type(3n) {
            margin-right: 0;
        }

        .pic-info {
            display: flex;
            font-size: 16px;
            margin-top: 10px;
            padding: 0 20px;
            line-height: 30px;

            .pic-img {
                display: block;
                font-size: 0;

                img {
                    width: 100px;
                    height: 100px;
                }
            }

            .num-img {
                width: 30px;
                height: 30px;
                margin-right: 10px;
            }
        }
    }
}
</style>
